fontbutton: Quote font family names
authorMatthias Clasen <mclasen@redhat.com>
Sun, 9 May 2021 00:53:44 +0000 (20:53 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 9 May 2021 00:54:50 +0000 (20:54 -0400)
Otherwise, spaces in family names will trip up
the css parser.

gtk/gtkfontbutton.c

index 091ecbfe1939aa38fbe15a4bc46eb54ce2b34ddb..2e2d136fdc74efd9cf2a7b4889cffeeabe7a8dc2 100644 (file)
@@ -1121,9 +1121,9 @@ pango_font_description_to_css (PangoFontDescription *desc,
   set = pango_font_description_get_set_fields (desc);
   if (set & PANGO_FONT_MASK_FAMILY)
     {
-      g_string_append (s, "font-family: ");
+      g_string_append (s, "font-family: \"");
       g_string_append (s, pango_font_description_get_family (desc));
-      g_string_append (s, "; ");
+      g_string_append (s, "\"; ");
     }
   if (set & PANGO_FONT_MASK_STYLE)
     {